home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
win
/
rtfhelp.zip
/
RTFHHELP.C
< prev
next >
Wrap
Text File
|
1994-11-06
|
3KB
|
99 lines
/*
======================================================================
RTFHelp Windows Help Generation Tool
(C) Copyright 1994 by J. Hlavaty
RTFHHelp.c
Help text and command line processing
======================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "rtfhelp.h"
int ProcessArgs( int argc, char **argv )
{
int thisarg = 1 ;
if ( 1 == argc ) // only RTFHELP <Enter> was typed, the user wants help...
{
printf("\tusage: RTFHELP <input-file(.hdc)> <output-file(.rtf)> (-o) (-f) (-q)\n") ;
printf("\t\twhere '-o' will disable output file overwrite warning\n") ;
printf("\t\t '-f:850' will translate input from code page 850\n") ;
printf("\t\t and '-q' will not output informational messages\n") ;
/* JH -- stubbed out of version 2.0...
* printf("\tThe '-rtf:<file name>' option will generate an HDC file\n") ;
* printf("\t\t from a valid RTF file generated by another RTF writer\n") ;
* printf("\t\t The 'rtf' flag may not be used with any other option\n") ;
*/
printf("\t\t '-c' will use old-style RTF generation (compatibility with\n") ;
printf("\t\t version 1.x). Don't use unless you have old-style .HDC files.\n") ;
printf("\tThis is a bound application and may be run in DOS or OS/2\n") ;
return FALSE ;
}
// process commands until done (thisarg == argc)
while ( thisarg != argc )
{
// is this a parameter or a file name?
if ( ( '-' == argv[thisarg][0] ) ||
( '/' == argv[thisarg][0] ) )
{ // ... a parameter
switch(tolower(argv[thisarg][1]))
{
case 'r': // -RTF:
/* if ( 2 == argc ) // generating HDC from RTF file
* {
* SetUpGeneration( argv[thisarg] ) ; // not in this version of RTFHelp
* }
* else
* {
* printf("\tRTFHELP: usage for HDC generation is RTFHELP -rtf:myfile(.rtf).\n") ;
* printf("\t\t No other options are permitted\n") ;
* return FALSE ;
* }
*/ break;
case 'o':
bOverwrite = TRUE ;
break;
case 'c':
bCondense = FALSE ;
printf("\tRTFHELP: compatibility mode will be used. Please convert\n") ;
printf("\t\t your old-style files to release 2.01+\n") ;
break;
case 'q':
bVerbose = FALSE ;
break;
case 'f': // 0 1 2 3 4 5
// ===========
// - f : 8 5 0
codepage = atoi(&argv[thisarg][3]) ;
break;
default:
printf("RTFHELP: unsupported option '%s'\n", argv[thisarg]) ;
}
}
else
{ // ... otherwise it is a file name...
if (NULL == pszInput) // if we have no first file, then this is the first
{
pszInput = argv[thisarg] ;
}
else // otherwise we have the second file name
{
pszOutput = argv[thisarg] ;
}
}
thisarg++ ;
} // increment count of arguments processed
return TRUE ;
}